<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //0转化为boolean为false
    //NaN转化为boolean为false
    //除了这两个 其它数字转化为boolean都是ture
    //undifined null转化后都是false
    //""空字符串转换是false，其它都是true
    var num=0;
    console.log(!!num);
    var notNum=NaN;
    console.log(!!notNum);
    var num1=123;
    var num2=-1;
    console.log(!!num1,!!num2);
    console.log(!!undifined);
    console.log(!!null);
    var str="";
    var spaceStr=" ";
    var str1="hello";
    console.log(!!str);//false
    console.log(!!spaceStr);//true
    console.log(!!str1);//true
    //转换方式分为隐式和显示转换
    //不同类型转换时，特殊值的转换结果
    var str2="hello js";
    var b1=Boolean(str2);

</script>
</html>